package com.common.converter;

import com.common.entity.casemanage.CaseQualityFlowEntity;
import com.common.vo.casemanage.CaseForQualityFlowVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author johnny
 * @create 2020-07-13 下午5:04
 **/
@Mapper
public interface CaseQualityConverter {

    CaseQualityConverter INSTANCE = Mappers.getMapper(CaseQualityConverter.class);


    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "registerDate", target = "registerDate", dateFormat = "yyyy-MM-dd"),
    })
    CaseForQualityFlowVo domain2vo(CaseQualityFlowEntity caseQualityFlowEntity);


    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "registerDate", target = "registerDate", dateFormat = "yyyy-MM-dd"),
    })
    CaseQualityFlowEntity vo2domain(CaseForQualityFlowVo caseForQualityFlowVo);
}